package com.rulestech.salespro.engine;

import com.rulestech.engine.EngineResult;
import com.rulestech.salespro.inventory.Discount;


/**
 * SalesProEngineResult implements the standard interface but also provide the APIs to access the SalesPro specific result from its engine.
 */
public class SalesProEngineResult implements EngineResult {
 
	private Discount discount;
	
	
	public Discount getDiscount(){
		return discount;
	}
	
	public void setDiscount(Discount discount){
		this.discount = discount;
	}

	@Override
	public String toString() {
		StringBuffer result = new StringBuffer("SalesProEngineResult:\ndiscounts:\n");
		result.append("discount: rate = " + discount.getRate());
		return result.toString();
	}

	@Override
	public boolean equals(Object obj) {
		return this.discount.equals(((SalesProEngineResult)obj).getDiscount());
	}
	
	
}
